package com.xiaolin.oa.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaolin.oa.model.dto.ProcessNodeDetail;
import com.xiaolin.oa.model.dto.ProcessNodeDto;
import com.xiaolin.oa.model.entity.CommonProcessNode;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 审批流程节点表 Mapper 接口
 * </p>
 *
 * @author xiaolin
 * @since 2024-08-22
 */
public interface CommonProcessNodeMapper extends BaseMapper<CommonProcessNode> {

    List<CommonProcessNode> getProcessNodeList(CommonProcessNode processNode);

    /**
     * 获取流程审批人所属组织架构
     * @param processId
     * @return
     */
    List<Integer> getProcessApproverOrgs(Integer processId);

    ProcessNodeDetail getFirstProcessNode(String processCode);

    ProcessNodeDetail getNextProcessNode(@Param("serialNumber") String serialNumber, @Param("processFlowId") Integer processFlowId);

    List<ProcessNodeDto> getProcessNodeListByProcessCode(String processCode);
}
